

import { MysqlSqlGenerator } from './mysql';
import { SqlGenerator } from './sql-generator';

export  function getSqlGenerator(dialect:Dialect):SqlGenerator {
  switch (dialect) {
    case Dialect.MYSQL:
      return new MysqlSqlGenerator();
    case Dialect.POSTGRESQL:
      // return new PostgreSqlGenerator();
    case Dialect.SQLITE:
      // return new SqliteGenerator();
    default:
      throw new Error(`不支持的dialect: ${dialect}`);
  }
}

export enum Dialect {
  MYSQL = 'mysql',
  POSTGRESQL = 'postgresql',
  SQLITE = 'sqlite',
}
